
package com.insigma.business.qrcode.welfare.service.impl;


import com.insigma.business.qrcode.common.service.SequenceGenerator;
import com.insigma.business.qrcode.soldier.dto.SequenceNameConstant;
import com.insigma.business.qrcode.welfare.dao.MarketingSpotDao;
import com.insigma.business.qrcode.welfare.dto.MarketingSpotBSearcher;
import com.insigma.business.qrcode.welfare.entity.MarketingSpotDO;
import com.insigma.business.qrcode.welfare.service.MarketingSpotService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("marketingSpotService")
public class MarketingSpotServiceImpl implements MarketingSpotService {

    @Autowired(required = false)
    private MarketingSpotDao marketingSpotDao;
    @Autowired(required = false)
    private SequenceGenerator sequenceGenerator;

    
    @Override
    public List<MarketingSpotDO> search(final MarketingSpotBSearcher marketingSpotBSearcher) {
        return marketingSpotDao.search(marketingSpotBSearcher);
    }
   
    @Override
    public MarketingSpotDO get(final String id){
        return marketingSpotDao.get(id);
    }

    
    @Override
    public Integer insert(final MarketingSpotDO marketingSpotDO){
        marketingSpotDO.setId(sequenceGenerator.genKey(SequenceNameConstant.MARKETING_SPOT_ID));
        return marketingSpotDao.insert(marketingSpotDO);
    }

    
    @Override
    public Integer update(final MarketingSpotDO marketingSpotDO){
        return marketingSpotDao.update(marketingSpotDO);
    }

    
    @Override
    public Integer delete(final String id, final String modifierType, final String modifierId){
        return marketingSpotDao.delete(id,modifierType,modifierId);
    }

    @Override
    public MarketingSpotDO getByCode(String code) {
        return marketingSpotDao.getByCode(code);
    }

}
